<h1>New document</h1>

<% form_for(@document) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :title %><br />
    <%= f.text_field :title %>
  </p>
  <p>
  <%= select("document", "category_id", Category.find(:all).collect {|c| [ c.name, c.id ] }, { :include_blank => false }) %>
  </p>
  <p>
    <%= f.label :summary %><br />
    <%= f.text_field :summary %>
  </p>
  <p>
    <%= f.label :creator %><br />
    <%= f.text_field :creator %>
  </p>
  <p>
    <%= f.label :content %><br />
    <%= f.text_area :content %>
  </p>
  <p>
    <%= f.submit "Create" %>
  </p>
<% end %>

<%= link_to 'Back', documents_path %>
